import os,re
root = "D:\\phpStudy\\PHPTutorial\\WWW\\others\\shelf_coupon\\shelf_coupon"

print('start');
for dirpath, dirnames, filenames in os.walk(root):
    for filepath in filenames:
    	path = os.path.join(dirpath, filepath)
    	fin = open(path, 'r',encoding='UTF-8') #以读的方式打开文件
    	str = fin.read()
    	#pattern = 'r"^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$"';
    	pattern = 'r"^checkAction$"';
    	# #re.match(pattern, strint, flags=0)
    	flag = re.findall(r'\d+\.\d+\.\d+\.\d+', str);
    	if(flag):
    	 	print(path)
    	 	print(flag)
        #print(os.path.join(dirpath, filepath))
print('end')